#include <iostream>
#include <queue>
#include <vector>
using namespace std;
#define int long long
 
signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n = 0, k = 0;
    cin >> n >> k;
    // vector<int> v(n);
    int x = 0; // 可以不开数组，直接一个变量接收
    int sum = 0;
    priority_queue<int> q; // 存偶数的堆
    for (int i = 0; i < n; ++i)
    {
        /*cin >> v[i];
        sum += v[i];
        if (v[i] % 2 == 0)
            q.push(v[i]);*/
        cin >> x;
        sum += x;
        if(x % 2 == 0)
            q.push(x);
    }
    while (k-- && !q.empty())
    {
        int x = q.top() / 2;
        q.pop();
        sum -= x;
        if (x % 2 == 0)
            q.push(x);
    }
    cout << sum;
    return 0;
}